<script type="text/ng-template" id="template-user-detail.html">
    
    <h4>
      <a class="btn btn-default btn-sm" href="#/user/all" title="返回用户列表"><i class="fa fa-angle-left"></i> 返回</a>
       用户 <span style="color: #5CB85C; font-weight: bold;">{{userinfo.username}}</span> 详细信息
    </h4>

    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-12 col-sm-2">
                <i class="fa fa-user" style="font-size: 100px;"></i>
            </div>
            <div class="col-xs-12 col-sm-8">
                <p>用户名：{{userinfo.username}}</p>
                <p class="text-muted small">注册时间：  {{userinfo.registetime}}</p>
            </div>
            <div class="col-xs-12 col-sm-2">
                <button class="btn btn-danger" ng-click="deleteUser()"><i class="fa fa-minus"></i> 删除此用户</button>
            </div>
        </div>
    </div>

    <div class="panel panel-info">
      <div class="panel-heading">
        <h3 class="panel-title">账户信息</h3>
      </div>
    <div class="panel-body">
      <div class="container-fluid">
          <div class="row">
              <div class="col-xs-12 col-sm-9 col-md-8">
                  <form class="form-horizontal" id="form-userinfo">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">真实姓名</label>
                        <div class="col-sm-8">
                          <input type="text" class="hide" ng-model="userinfo.userid">
                          <input type="text" class="form-control" placeholder="真实姓名" ng-model="userinfo.realname">
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="col-sm-2 control-label">性别</label>
                        <div class="col-sm-8">
                          <label class="radio-inline" ng-repeat="g in genderMap">
                            <input type="radio" name="gender" value="{{g.value}}" ng-model="userinfo.gender" ng-checked="(g.value == userinfo.gender) || (!userinfo.gender && g.value==0)">
                            {{g.text}}
                          </label>
                        </div>
                      </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">邮箱</label>
                      <div class="col-sm-8">
                        <input type="email" class="form-control" placeholder="邮箱" ng-model="userinfo.email">
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">手机号</label>
                      <div class="col-sm-8">
                        <input type="text" class="form-control" placeholder="手机号" ng-model="userinfo.cellphone">
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">身份证号</label>
                      <div class="col-sm-8">
                        <input type="text" class="form-control" placeholder="身份证号" ng-model="userinfo.idcardnum">
                      </div>
                    </div>
                      <div class="form-group">
                        <label class="col-sm-2 control-label">地区</label>
                        <div class="col-sm-8">
                          <input type="text" class="form-control" placeholder="地区" ng-model="userinfo.area">
                        </div>
                      </div>
                      <div class="col-sm-offset-2">
                        <button class="btn btn-success" ng-click="updateUserInfo(userinfo.userid)">保存更改</button>
                      </div>
                    </form>
                </div>
            </div>
        </div>
      </div>

      <div class="panel-heading">
        <h3 class="panel-title">业务</h3>
      </div>
      <div class="panel-body">
        <div class="container-fluid">
            <div class="row">
              <div class="col-xs-6 col-sm-4 col-md-3" style="margin-bottom: 10px;" ng-repeat="bus in typeList">
                <div class="btn-group">
                  <div class="btn btn-default">
                    <span>{{ bus.typename }}</span>
                  </div>
                  <span class="btn btn-danger" ng-click="deleteTypeForUser(bus.id)">
                    <i class="fa fa-times"></i>
                  </span>
                </div>
              </div>

              <div class="col-xs-3 col-sm-3" ng-show="!ifShowAddTypeView">
                <button class="btn btn-default" ng-click="ifShowAddTypeView=true">
                  <i class="fa fa-plus-circle"></i> 添加业务
                </button>
              </div>
            </div>

            <div class="row">
            <hr>
              <div class="col-xs-12 col-sm-4">
                <select class="form-control" ng-model="newType" ng-show="ifShowAddTypeView">
                  <option value="">Please select</option>
                  <option ng-repeat="type in typeListAll" value="{{type.id}}">{{type.name}}</option>
                </select>
              </div>

              <div class="col-xs-12 col-sm-6" ng-show="ifShowAddTypeView">
                <button class="btn btn-success" ng-click="addTypeForUser()">
                  &nbsp;完&nbsp;成&nbsp;
                </button>
                <button class="btn btn-default" ng-click="ifShowAddTypeView=false">
                  <i class="fa fa-times"></i> 取消
                </button>
              </div>

            </div>
        </div>
      </div>


      <div class="panel-heading">
        <h3 class="panel-title">登录日志</h3>
      </div>
      <div class="panel-body">
        最近一次登录时间：<span class="">{{ loginInfo.lastLoginTime }}</span> &nbsp;
         <span class="badge" ng-show="loginInfo.fromNow">{{ loginInfo.fromNow }}</span>
      </div>

    </div>
</script>